package com.eds.feign;


import com.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @ClassName：UserService
 * @Author: vvSmile
 * @Date: 2025/03/19
 * @Description: 必须描述类做什么事情, 实现什么功能
 */
@FeignClient("eds-frontend-user")
public interface UserService {
    //根据Token获取用户信息
    @PostMapping("/userController/getUserIdFromToken")
    public Long getUserIdFromToken(@RequestParam("token") @RequestHeader("authorization") String token);

    //根据用户Id获取用户信息
    @GetMapping("/userController/getUserByUserId")
    public User getUserByUserId(@RequestParam("userId") Long userId);

    @GetMapping("/userController/getAllTeachersCourses")
    public List<User> getAllTeachersCourses();

    //获取所有用户
    @GetMapping("/userController/getAllUser")
    List<User> getAllUser();
}
